<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<meta http-equiv="Expires" CONTENT="-1">
<meta http-equiv="Cache-Control" CONTENT="no-cache">
<meta http-equiv="Pragma" CONTENT="no-cache">
<link rel="stylesheet" href="{:C('VSHOP_CSS')}person.css"/>
<script src="{:C('VSHOP_JS')}jquery-1.9.1.min.js"></script>
</head>
<body>
<header>
  <div class="head"><a href="javascript:history.go(-1);" class="head-return"></a><!-- <a href="#" class="head-edit"></a> -->
    <h2 class="head-title">编辑地址</h2>
  </div>
</header>
<main>
  <div class="person-box">
    <ul>
   <form action="{:U('Address/Saveedit')}" method="post">
      <li><em>收货人姓名</em>
        <input name="consignee" type="text" class="txt" placeholder="" value="{$dre.consignee}">
      </li>
      <li><em>手机/电话</em>
        <input name="phone" type="text" class="txt" placeholder="" value="{$dre.phone}">
      </li>
      <li><em>地址</em> <span class="select-box"><span>
        <select name="shengid" id="shengid" onchange="javascript:area();" >
      <foreach name="sheng" key="key" item="she">
          <option value="{$key}">{$she}</option>
          </foreach>
          <foreach name="all" key="key" item="sheng">
          <option value="{$key}">{$sheng}</option>
          </foreach>
        </select>
        </span><span>


        <select name="shiid" id="shiid" onchange="javascript:county();">
          <foreach name="shi" item="city" key="key">
          <option value="{$key}"><?php echo $city?></option>
          </foreach>
        </select>
        </span><span>
        <select name="countyid" id="countyid">
        <foreach name="county" item="count" key="key">
          <option value="{$key}">{$count}</option>
          </foreach>
        </select>
        </span></span></li>
        <li><em>详细地址</em>
        <input name="address" type="text" class="txt" placeholder="" value="{$dre.address}">
      </li>
      <!--是否默认st-->
       <input name="isdefault" type="radio" value="1" 
       <if condition="$dre['isdefault'] eq 1 ">checked=1</if>  >是
       <input name="isdefault" type="radio" value="2"  <if condition="$dre['isdefault'] eq 0 ">checked=1</if> >否      
       <!--是否默认end-->
      <div class="blank15"></div>
     
     <input type="submit" value="确定" class="btn-red" />
     <input type="hidden" name="id" value="{$dre.id}">
     </form>
    </ul>
  </div>
</main>
<div class="blank10"></div>
<script type="text/javascript">
function area()
  {
    var id=$("#shengid").val();
    
     jQuery.get('{:U("Address/ajaxdress")}',
      {id:id},
      function(data){
       $('#shiid option').remove("option[value !=0]");
         var str='<option value=0>请选择</option>';
         $("#shiid").append(str);
        $('#shiid').append(data);
        
      },'text');      
  }
  function county()
  {
     var id=$("#shiid").val();
    
     jQuery.get('{:U("Address/ajaxdress")}',
      {id:id},
      function(data){
       $('#countyid option').remove("option[value !=0]");
         var str='<option value=0>请选择</option>';
         $("#countyid").append(str);
        $('#countyid').append(data);
        
      },'text');      
  }

</script>

</body>
</html>
